import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm'

@Entity()
export class SmsCode {
  @PrimaryGeneratedColumn()
  id: number

  @Column({ length: 11 })
  phone: string

  @Column({ length: 6 })
  code: string

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  createdAt: Date

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP', onUpdate: 'CURRENT_TIMESTAMP' })
  updatedAt: Date
}
